import { createSlice } from "@reduxjs/toolkit";

const kindSlice = createSlice({
    name: 'kind',
    initialState: {
        kindList: []
    },
    reducers: {
        changeKindList(state, action){
            state.kindList = action.payload
        }
    }
})

// console.log(kindSlice);

// actions 就是创建切片时的 reducers 中的修改方法
export const { changeKindList } = kindSlice.actions

// kindSlice.reducer 可以理解为全局状态的切片
export default kindSlice.reducer
